<body>
    <p>This tests that the video element's timeline controls are draggable in full screen.  Press any key to continue.</p>
    <video id="video" width="300" controls></video>
    <script>
        if (window.internals)
            runPixelTests = internals.runtimeFlags.forceOverlayFullscreenVideoEnabled;
    </script>
    <script src="full-screen-test.js"></script>
    <script src="../media/media-controls.js"></script>
    <script>
        var video = document.getElementById('video');
        enableTestMode(video);
        var timeline;

        waitForEvent(document, 'webkitfullscreenchange', function() {
            if (window.internals) {
                timeline = mediaControlsElement(internals.shadowRoot(video).firstChild, '-webkit-media-controls-timeline');
                var box = internals.boundingBox(timeline);

                eventSender.mouseMoveTo(box.left + 50, box.top + 5);

                waitForEvent(timeline, 'mousedown');
                eventSender.mouseDown();

                waitForEvent(timeline, 'mouseup');
                waitForEventOnceAndEnd(video, 'seeked');
                eventSender.mouseUp();
            }
            else
                logResult(false, "window.internals == undefined");
        });

        waitForEvent(video, 'canplaythrough', function() {
          // Run with garbage key. User input is needed to go into fullscreen,
          // and since the video will be in focus, we cannot use space as it
          // will play the video.
          runWithKeyDown(function(){video.webkitRequestFullScreen()}, 'a');
        });

        video.src = '../media/content/test.ogv';
    </script>
</body>
